import Http from '../mpf/http/http.js';

module.exports = {
  /**
   * 首页头部
   */
  homeBanner: (config) => { return Http.get('/rest/view/tgGoods/index', config); },
  /**
   * 首页商品列表
   */
  homeGoodsList: (config) => { return Http.get('/rest/view/tgGoods/goodsList', config); },
  /**
   * 预约商品（首页列表 列表页列表）
   */
  orderingList: (config) => { return Http.get('/rest/view/tgGoods/reserveGoodsList', config); },
  /**
   * 初始化应用配置
   */
  init: (success) => {
    return Http.get('/rest/member/getMemberInfo', {
      success: function (response) {
        wx.setStorage({
          key: "initData",
          data: response.data
        })
        Http.get('/rest/view/tg/getCenterInfo', {
          success: function (response) {
            wx.setStorage({
              key: "userData",
              data: response.data
            })
          }
        })
      }
    })
  },
};